<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from '../components/HelloWorld.vue'
import { useCounterStore } from '@/stores/counter'
import router from '@/router';
const store=useCounterStore();
import { reactive, toRefs } from 'vue'

const state = reactive({
  circleUrl:
    'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
  squareUrl:
    'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png',
  sizeList: ['small', '', 'large'] as const,
})

const { circleUrl, squareUrl, sizeList } = toRefs(state)

const ext=()=>{
  store.staves.roleId=""
        store.staves.roleName=""
        store.staves.token=""
        store.staves.userId=""
        store.staves.userName=""
        store.staves.userNikename=""
        router.push("/")
}

</script>



<template>
  <div class="common-layout">
    <el-container>
      <el-header style="background-color:#545c64 ;">
 <div>
      <el-avatar
         src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
      />
    </div>
        <div style="color:aliceblue;margin: 1%; " >
         登录人:{{ store.staves.userNikename }}
        </div>  
        <div>
          <el-button @click="ext" type="danger" style="margin: 1100%;" >退出登录</el-button>
        </div>

      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-col :span="25">     
      <el-menu
        active-text-color="#ffd04b" router
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="2"
        text-color="#fff"

      >
        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>     
             <span>用户信息</span>    
          </template>       
            
            <el-menu-item index="/ShowUser">查看用户信息</el-menu-item>     
            <el-menu-item index="/UserAdd">增加用户信息</el-menu-item> 
        </el-sub-menu>
     <el-sub-menu index="2" >
          <template #title >
            <el-icon><location /></el-icon>
           <span>权限信息</span>    
          </template>              
            <el-menu-item index="/PermissionAdd">增加权限</el-menu-item>      
            <el-menu-item index="/ShowPermission">查看权限信息</el-menu-item>        
        </el-sub-menu>

      </el-menu>
    </el-col>
        </el-aside>
        <el-main style="margin: 4%;">
            <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>





<style scoped>
header {
  line-height: 1.5;
  max-height: 100vh;
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

nav {
  width: 100%;
  font-size: 12px;
  text-align: center;
  margin-top: 2rem;
}

nav a.router-link-exact-active {
  color: var(--color-text);
}

nav a.router-link-exact-active:hover {
  background-color: transparent;
}

nav a {
  display: inline-block;
  padding: 0 1rem;
  border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
  border: 0;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }

  nav {
    text-align: left;
    margin-left: -1rem;
    font-size: 1rem;

    padding: 1rem 0;
    margin-top: 1rem;
  }
}
</style>
